const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT.UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    template_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "模板id",
      field: "template_id"
    },
    type: {
      type: DataTypes.INTEGER(3).UNSIGNED,
      allowNull: true,
      defaultValue: "1",
      primaryKey: false,
      autoIncrement: false,
      comment: "展示范围（0全部, 1详情, 2基础）默认1详情",
      field: "type"
    },
    name: {
      type: DataTypes.CHAR(180),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "参数名称",
      field: "name"
    },
    value: {
      type: DataTypes.CHAR(230),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "参数值",
      field: "value"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    }
  };
  const options = {
    tableName: "sxo_goods_params_template_config",
    comment: "",
    indexes: [{
      name: "template_id",
      unique: false,
      type: "BTREE",
      fields: ["template_id"]
    }, {
      name: "type",
      unique: false,
      type: "BTREE",
      fields: ["type"]
    }]
  };
  const SxoGoodsParamsTemplateConfigModel = sequelize.define("sxo_goods_params_template_config_model", attributes, options);
  return SxoGoodsParamsTemplateConfigModel;
};